package com.dpp.mapper;

import com.dpp.entity.UserMoney;
import com.dpp.entity.Users;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMoneyMapper  {
    @Select("select * from user_money where openid = #{openId}")
    UserMoney selectById(String openid);
    @Insert("INSERT INTO  user_money(openid, paopao_coins, money) VALUES (#{openid},#{paopaoCoins},#{amount})")
    void insert(String openid, Integer amount, Integer paopaoCoins);
    @Update("update user_money set paopao_coins=paopao_coins+#{paopaoCoins} ,money=money+#{amount} where openid=#{openid}")
    void update(String openid, Integer amount, Integer paopaoCoins);
}
